//
//  YRJSearchResultUserTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/11/4.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJSearchResultUserTableViewCell.h"
#import "YRJTripHeader.h"

@implementation YRJSearchResultUserTableViewCell
- (void)dealloc {
    [_avatarImageView release];
    [_usernameLabel release];
    [_titleLabel release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.avatarImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.avatarImageView];
    [_avatarImageView release];
    
    self.usernameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.usernameLabel];
    [_usernameLabel release];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    self.titleLabel.font = [UIFont systemFontOfSize:14 * (SWIDTH / 375)];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.avatarImageView.frame = CGRectMake(20, 5, kWidth / 6, kWidth / 6);
    self.avatarImageView.layer.cornerRadius = kWidth / 12;
    self.avatarImageView.layer.masksToBounds = YES;
    self.usernameLabel.frame = CGRectMake(kWidth / 5 + 30, (10.0 / 667) * SHEIGHT, kWidth / 5 * 4 - 30, (kHeight - 20) / 2);
    self.titleLabel.frame = CGRectMake(kWidth / 5 + 30, kHeight / 2, kWidth / 5 * 4 - 30, (kHeight - 20) / 2);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
